﻿namespace _02.BankExersice.Customers
{
    using System;

    public abstract class Customer
    {
        private string name;

        protected Customer(string name, string phoneNumber)
        {
            this.Name = name;
            this.PhoneNumber = phoneNumber;
        }

        public string PhoneNumber { get; set; }

        public string Name
        {
            get
            {
                return this.name;
            }

            protected set
            {
                if (value == null)
                {
                    throw new ArgumentNullException("Customer name must not be empty!");
                }

                this.name = value;
            }
        }

        public override string ToString()
        {
            return this.Name;
        }
    }
}
